package com.wc.utils;

import com.wc.service.AdminService;
import com.wc.service.impl.AdminServiceImpl;

import java.sql.SQLException;
import java.util.Timer;
import java.util.TimerTask;

public class MyTimerTask extends TimerTask {
    private Timer timer;

    public MyTimerTask(Timer timer) {
        this.timer = timer;
    }
    private AdminService adminService = new AdminServiceImpl();

    @Override
    public void run() {
        try {
            adminService.updateAllSaltAndPassword();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        timer.cancel();
    }
}
